#include<iostream>
#include<vector>
#include<queue>
#include<cstring>
#include<cmath>
#include<map>
#include<set>
#include<cstdio>
#include<algorithm>
#define debug(a) cout<<#a<<"="<<a<<endl;
using namespace std;
const int maxn=1e7;
typedef long long LL;

inline __int128 read()
{
    __int128 x=0,f=1;
    char ch=getchar();
    while(ch<'0'||ch>'9')
    {
        if(ch=='-')
            f=-1;
        ch=getchar();
    }
    while(ch>='0'&&ch<='9')
    {
        x=x*10+ch-'0';
        ch=getchar();
    }
    return x*f;
}

inline void write(__int128 x)
{
    if(x<0)
    {
        putchar('-');
        x=-x;
    }
    if(x>9)
        write(x/10);
    putchar(x%10+'0');
}

struct P{
   LL a,b;
}w[25];
LL p[30];
__int128 dp[1<<21];

int main(void)
{
  cin.tie(0);std::ios::sync_with_stdio(false);
  p[0]=1;
  for(LL i=1;i<=20;i++) p[i]=p[i-1]*2;
  LL n,x;cin>>n>>x;
  for(LL i=1;i<=n;i++){
    LL a,b;cin>>a>>b;
    w[i].a=a;w[i].b=b;
  }
  dp[0]=x;
  for(LL j=0;j<=(1<<n);j++){
    for(LL i=1;i<=n;i++){
        if(j&(1<<(i-1))){
            dp[j]=max(dp[j],dp[j^(1<<(i-1))]*w[i].a+w[i].b);
        }
    }
  }
  write(dp[(1<<n)-1]);
return 0;
}
